package com.ft.springboottravel.mapper;

import com.ft.springboottravel.bean.Category;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface CategoryMapper {

    List<Category> selectAllCategoryList(@Param("cateName")String cateName,@Param("currentPage")Integer currentPage,@Param("pagersNumber")Integer pagersNumber);

    Long selectAllCategoryListToLong(String cateName);
    @Insert("insert into category value(0,${cateName})")
    void addCategory(String cateName);
    @Select("select * from  category where cate_id = #{cateId}")
    Category selectCategoryByCateId(Integer cateId);
    @Update("update category set cate_name=#{cateName} where cate_id=#{cateId}")
    void editCategoryByCategory(Category category);

    @Select("select * from category")
    List<Category> selectCategoryList();

}
